
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Ribbon.Primitives;
using System.Windows.Input;
using System.Windows.Shapes;

namespace SnowLotus
{

    public sealed class Manager
    {
        private static List<UIElement> list_shapes = new List<UIElement>();


        public static void Clear()
        {
            list_shapes.Clear();
        }

        public double Number => list_shapes?.Count ?? 0;


        public static void AddShape(UIElement shape)
        {
            if (!list_shapes.Contains(shape))
            {
                list_shapes.Add(shape);

                if (myCanvas != null)
                {


                    foreach (UIElement s in list_shapes)
                    {
                        if (!myCanvas.Children.Contains(s))
                        {
                            myCanvas.Children.Add(s);
                        }
                    }
                }
            }





        }

        internal static System.Windows.Controls.Canvas myCanvas;
        /// <summary>
        /// use canvas
        /// </summary>
        /// <param name="parent"></param>
        public static void Register(System.Windows.Controls.Canvas parent)
        {
            myCanvas = parent;
        }

    }

}
